Skip to content

Retry GKE cluster creation on internal errors - #482

Open
gauron99 wants to merge 2 commits into
mainfrom
gauron99/gke-retry-internal
Open

gauron99 wants to merge 2 commits into
mainfrom
gauron99/gke-retry-internal

Conversation

@gauron99

Copy link
Copy Markdown

kubetest2 retries a failed GKE cluster create in the next region only when the error matches --retryable-error-patterns. Two fixes to that list:

  1. The node registration pattern never matches. It came from the Go code of kntest, where \d sat in a raw string. When Deprecate calling kubetest2 via kntest #230 moved the call into bash, it became \\d inside single quotes, which reaches the Go regexp as a literal backslash.
  2. GKE can fail a create with a server-side error, canonicalCode: CanonicalCodeValueValuesEnum(INTERNAL, 14) and Failed to create cluster, which no pattern matches. Now it does, so kubetest2 deletes the failed cluster and tries us-central1.

Seen on knative-extensions/eventing-kafka-broker#4830, where two jobs failed this way in us-east1 after 26 minutes, while seven other jobs started at the same time got clusters:

I checked both patterns with Go's regexp against the flag value as bash passes it, and the INTERNAL one against the error string from the job above. kubetest2 splits the flag on commas, so the new pattern has none.

cc @dsimansk

The pattern came from the Go code of kntest, where `\d` sat in a raw
string. When #230 moved the kubetest2 call into bash, it became `\\d`
inside single quotes, which reaches the Go regexp as a literal
backslash. The pattern never matches "only 2 nodes out of 3 have
registered", so kubetest2 never retries that error in the next region.
GKE can fail a cluster create with a server-side error after it ran
for a while:

  canonicalCode: CanonicalCodeValueValuesEnum(INTERNAL, 14)
  message: 'Failed to create cluster'

None of the retry patterns match it, so the job fails before any test
runs. On 2026-10-27 this failed two jobs of
knative-extensions/eventing-kafka-broker#4830 in us-east1 after 26
minutes, while seven other jobs started at the same time got clusters.

Match the INTERNAL code, so kubetest2 deletes the failed cluster and
tries the next region. The pattern has no comma, because kubetest2
splits the flag on commas.
@knative-prow

knative-prow Bot commented Oct 27, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 27, 2026
@dsimansk

Copy link
Copy Markdown
Contributor

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants